diff options
| author | real-zephex <[email protected]> | 2024-03-29 14:38:23 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-03-29 14:38:23 +0530 |
| commit | d9a9535ea8f38a1d63a7accd77e7175d5b822284 (patch) | |
| tree | 02680d7deb0f1b811fd00c42df86eabc24aee31d /src/app/manga/[title]/[id]/buttons.jsx | |
| parent | Update README.md (diff) | |
| download | dramalama-d9a9535ea8f38a1d63a7accd77e7175d5b822284.tar.xz dramalama-d9a9535ea8f38a1d63a7accd77e7175d5b822284.zip | |
fix: manga page now indicates what chapter you are reading
Diffstat (limited to 'src/app/manga/[title]/[id]/buttons.jsx')
| -rw-r--r-- | src/app/manga/[title]/[id]/buttons.jsx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/app/manga/[title]/[id]/buttons.jsx b/src/app/manga/[title]/[id]/buttons.jsx index eec62b9..19da1d3 100644 --- a/src/app/manga/[title]/[id]/buttons.jsx +++ b/src/app/manga/[title]/[id]/buttons.jsx @@ -1,7 +1,9 @@ +"use client"; + import styles from "./info.module.css"; import Link from "next/link"; -export default async function Buttons({ content: data }) { +export default function Buttons({ content: data }) { return ( <div className={styles.ChapterContainer}> {data.chapters && @@ -12,10 +14,10 @@ export default async function Buttons({ content: data }) { key={index} href={{ pathname: `/manga/info/read/${item.id}`, - query: { - name: item.title, - }, }} + onClick={() => + test(item.chapterNumber, item.volumeNumber) + } > <button key={index}> <div> @@ -30,3 +32,8 @@ export default async function Buttons({ content: data }) { </div> ); } + +function test(chapter, volume) { + localStorage.setItem("chapter", chapter); + localStorage.setItem("volume", volume); +} |